#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int arr1[20] = { 0 };
	int arr2[20] = { 0 };
	int num1, num2; scanf("%d", &num1);
	for (int i = 0; i < num1; i++)
	{
		scanf("%d", &arr1[i]);
	}
	scanf("%d", &num2);
	for (int i = 0; i < num2; i++)
	{
		scanf("%d", &arr2[i]);
	}
	int copy_arr1[20] = { 0 };
	int copy_arr2[20] = { 0 };
	for (int i = 0; i < num1; i++)
	{
		copy_arr1[i] = arr1[i];
	}
	for (int i = 0; i < num1; i++)
	{
		copy_arr2[i] = arr2[i];
	}
	for (int i = 0; i < num1; i++)
	{
		for (int j = 0; j < num2; j++)
		{
			if (arr1[i] == copy_arr2[j])
			{
				arr1[i] -= copy_arr2[j];
				break;
			}
		}
	}
	for (int i = 0; i < num2; i++)
	{
		for (int j = 0; j < num1; j++)
		{
			if (arr2[i] == copy_arr1[j])
			{
				arr2[i] -= copy_arr1[j];
				break;
			}
		}
	}
	for (int i = 0; i < num1; i++)
	{
		for (int j = i + 1; j < num1; j++)
		{
			if (arr1[i] == arr1[j])
			{
				arr1[i] -= arr1[j];
				break;
			}
		}
	}
	for (int i = 0; i < num2; i++)
	{
		for (int j = i + 1; j < num2; j++)
		{
			if (arr2[i] == arr2[j])
			{
				arr2[i] -= arr2[j];
				break;
			}
		}
	}
	for (int i = 0; i < num1; i++)
	{
		if (arr1[i] != 0)
		printf("%d ", arr1[i]);
	}
	for (int i = 0; i < num2; i++)
	{
		if(arr2[i]!=0)
		printf("%d ", arr2[i]);
	}
	return 0;
}